﻿function validate() {
    username = $("#txtUsername");
    password = $("#txtPass");
    checkcode = $("#CheckCode");
    if (username.val().length == 0) {
        alert("请输入用户名！");
        username.focus();
        return false;
    }
    if (password.val().length == 0) {
        alert("请输入密码！");
        password.focus();
        return false;
    }

    if (checkcode.val().length == 0) {
        alert("请输入验证码！");
        checkcode.focus();
        return false;
    }
    return true;
}
function CheckUserName() {
    var strAccount = $("#txtUserAccount").val();
    if (strAccount != "") {
        $.ajax({
            type: "GET",
            url: "/Ashx/AddAccountCheckAccount.ashx",
            dataType: "text",
            data: { strAccount: strAccount },
            error: function (e) { alert(e.toString() + "！"); },
            success: function (result) {
                if (result != "该账号可用！") {
                    alert(result);
                    $("#txtUserAccount").focus();
                    return false;
                }
                return true;
            }
        });
    }
}